package saleMarket.service.authority;

import saleMarket.dao.authority.RoleDao;
import saleMarket.domain.authority.Actor;
import saleMarket.domain.authority.Role;
import util.JdbcHelper;

import java.sql.Connection;
import java.sql.SQLException;

public class RoleService {
    private static final RoleDao roleDao = RoleDao.getInstance();
    private static final RoleService roleService = new RoleService();

    public static RoleService getInstance() {
        return roleService;
    }

    public Role find(Integer id) throws SQLException {
        //创建连接对象
        Connection connection = JdbcHelper.getConn();
        Role role = roleDao.find(connection,id);
        //关闭连接
        JdbcHelper.close(connection);
        return role;
    }

}
